from util.common import *

if __name__ == '__main__':

    file = open('/Users/lujiewen/asiainfo-sec/fujian-data/source/福建password_200902.txt', 'r', encoding='utf-8')
    w_sql_list = []

    sqp = 105928
    idx = 1
    for item in file:
        if item:
            sqp += 1
            idx += 1
            if idx > 200000:
                break
            seep = {
                "id": "WORDZX" + random_string(14),
                "sqp": sqp,
                "item": item.strip(),
            }

            message1 = render_template("""
                   INSERT INTO TF_WC_WORDLIST (id, SEQUENCE, VALUE, STAR, RSRV_STR1, RSRV_DATE2, RSRV_STR2)
                VALUES ($id, $sqp, $item, NULL, NULL, NULL, NULL);
                          """, seep)

            w_sql_list.append(message1)

    write_file('target/SATP_弱口令.sql', w_sql_list)
